package com.xgxd.modules.servcie;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;


@Component
@Configuration      //1.主要用于标记配置类，兼备Component的效果。
@EnableScheduling
public class AutoSendTask {
    @Autowired
    private EirService eirService;

    @Scheduled(cron = "0 0/5 * * * ?")
    public void a(){
        List<Map<String, Object>>  list =  eirService.getTask();
        list.forEach(l->{
            eirService.ymlPutTask(l.get("YMSEQN").toString().trim());
        });
        System.out.println("-----------------------"+list.size());
    }
}
